<template>
  <div class=""></div>
</template>

<script>
import axios from 'axios'

let getAllTopic = async function (self, info) {
  self.info = info
  let obj = {topicId: info.modelId}
  if (self.$store.state.user.isLogin) {
    obj.userId = self.$store.state.user.user.user.userId
  }
  // 话题内容
  let resEc = await axios.post('/mscs/topic/findTopicContentById', self.$paramsConvert(obj))
  // console.log(resEc);
  self.topic = Object.assign({}, self.topic, resEc.data.data)
  // 获取评论内容
  let resComment = await axios.post('/mscs/topic/findCommentByType', self.$paramsConvert(obj))
  // console.log(resComment);
  self.topic.comment = resComment.data.data
}

export default {
  name: "topicdetails",
  title: "话题内容",
  props: {
    row: {}
  },
  data () {
    return {
      topic: {}
    }
  },
  mounted () {
    this.getContent()
  },
  methods: {
    getContent () {
      getAllTopic(this, this.row).then(res => {}).catch(error => {
        // vm.$catchError(error)
      })
    }
  }
}
</script>
